import XtxCarousel from "@/components/library/xtxCarousel";
import "./index.scss";
import { useAxiosWithAuth } from "@/utils/useAxiosWidthAuth";
import { useEffect, useState } from "react";
function HomeBanner() {
  const axios = useAxiosWithAuth();
  useEffect(() => {
    async function getCarousel() {
      const res: any = await axios({
        method: "get",
        url: "/home/banner",
      });
      console.log(res.result);

      setcarouselList(res.result);
    }
    getCarousel();
  }, []);
  const [carouselList, setcarouselList] = useState<any[]>([]);
  return (
    <div className="home-banner">
      <XtxCarousel autoplay carouselList={carouselList} />
    </div>
  );
}

export default HomeBanner;
